<?php
include '_init_.php';
	$orderManager = Order_Manager::getOrderManager($_REQUEST['id']);
	
	echo $orderManager->getStatus()
if($orderManager == null)
	exit("Not exist");
if($orderManager->getStatus() != 'close')
	exit("Not allowed");
$orderManager->init();


$act = isset($_REQUEST['act'])?$_REQUEST['act']:'';
if($act == 'save')
{
	$orderManager->setCustomerInfo($_REQUEST);
	$orderManager->persistOrderInfo();
	AppMain::refreshParentFrame();
}

$orderInfo = $orderManager->getInfo();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form action="cosic.php">
<input type="hidden" name="act" value="save"/>
<input type="hidden" name="id" value="<?php echo $orderManager->getId();?>"/>
<div class="mainf-8">
  <ul>
  <li class="maina-1k">電子郵件及地址資料管理</li>
     <li class="mainf-1m"><img src="images/line5.gif" width="676" height="7" align="top" /></li>
    <li class="mainf-1k">
      地址<img src="images/line3.gif" width="21" height="12" /><input name="address_part_one" type="text"  class="maine-keyind" value="<?php echo Util::html_safe($orderInfo['customerinfo']['address']['part_one']);?>"/><input name="address_part_two" type="text"  class="maine-keyinb" value="<?php echo Util::html_safe($orderInfo['customerinfo']['address']['part_two']);?>"/><input name="address_part_three" type="text"  class="maine-keyinc" value="<?php echo Util::html_safe($orderInfo['customerinfo']['address']['part_three']);?>"/></li>
      <li class="mainf-1k">電郵1<img src="images/line3.gif" width="21" height="12"/><input name="email" type="text"  class="maine-keyina" value="<?php echo Util::html_safe($orderInfo['customerinfo']['email']);?>"/>
      </li>
      <li class="mainf-1k">電郵2<img src="images/line3.gif" width="21" height="12"/><input name="email2" type="text"  class="maine-keyina" value="<?php echo Util::html_safe($orderInfo['customerinfo']['email2']);?>"/>
      </li>
  </ul>
</div>

<div class="mainf-7">
<ul>
<li class="article-1g"><input name="" type="button" class="article-1a_btn" value="儲存" onclick="document.forms[0].submit();return false;"/></li>
</ul>
</div>
</form>
</body>
</html>